package hig.no.group;

import android.app.Activity;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class Assignment2 extends Activity implements OnClickListener {
	private ImageButton silent ;
	private ImageButton service ;
	private ImageButton set;
	private ImageButton list;
	
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        	
        silent = (ImageButton) findViewById(R.id.imageButton1);
        silent.setOnClickListener(this);
        service = (ImageButton) findViewById(R.id.imageButton2);
        service.setOnClickListener(this);
        set = (ImageButton) findViewById(R.id.imageButton3);
        set.setOnClickListener(this);
        list = (ImageButton) findViewById(R.id.imageButton4);
        list.setOnClickListener(this);
    }
    
    @Override
    public void onClick(View v){
    	switch(v.getId()){
    	
    	case R.id.imageButton1:
    		AudioManager amanager = (AudioManager)getSystemService(AUDIO_SERVICE);
			amanager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
    	break;
    	
    	case R.id.imageButton2:
    		Intent itroyano = new Intent(this, StartService.class);
        	sendBroadcast(itroyano);
    	break;
    	
    	case R.id.imageButton3:
    		Intent settings = new Intent(this, GetGPSLocation.class);
    		startActivity(settings);
    	break;
    	
    	case R.id.imageButton4:
    		Intent listposition = new Intent(this, ListSettings.class);
    		startActivity(listposition);
    	break;
    	}
    	
    	
    }
    
    
}